package com.lisen.test.webservice.service.impl;

import java.util.Arrays;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.log4j.Logger;

public class Portal602MethodInterceptor implements MethodInterceptor {
	static Logger log = Logger.getLogger(Portal602MethodInterceptor.class);

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		// 调用目标方法之前执行的动作
		log.debug("调用方法之前: invocation对象：[" + invocation + "]");
		// 调用目标方法
		Object rval = invocation.proceed();
		// 调用目标方法之后执行的动作
		Object[] args = invocation.getArguments();
		log.info(invocation.getClass());
		log.info("方法调用结束...");
		log.info("目标方法的返回值是 : " + rval);
		log.info("目标方法是 : " + invocation.getMethod());
		log.info("目标方法的参数是 : " + Arrays.asList(args).toString());
		log.debug("调用结束...");
		return rval;
	}

}
